package com.dy.lock.screen.dao.impl;


import java.util.List;

import org.springframework.stereotype.Repository;

import com.dy.lock.screen.dao.ChatDao;
import com.dy.lock.screen.pojo.ChatInfo;

@Repository("chatDao")
public class ChatDaoImpl extends BaseDaoImpl<ChatInfo, String> implements ChatDao {

	@Override
	public String getQueryNamespace() {
		return "mybatis.xml.ChatMapper";
	}

	@Override
	public String queryMaxId() {
		String maxId = this.getSqlSession().selectOne(this.getQueryNamespace() + ".queryMaxId");
		return maxId;
	}

	@Override
	public List<ChatInfo> queryLastByGoodsId(String goodsId) {
		return this.getSqlSession().selectList(this.getQueryNamespace() + ".queryLastByGoodsId",goodsId);
	}

	@Override
	public List<ChatInfo> queryAllChatByGoodsId(String goodsId) {
		return this.getSqlSession().selectList(this.getQueryNamespace() + ".queryAllChatByGoodsId",goodsId);
	}

}
